home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / shared.dxr / 04474_Universal InterFace Controls -2 -.ls < prev    next >
Encoding:
Text File  |  1996-02-21  |  7.5 KB  |  191 lines

  1. global gWorld, gStates, gOBJECTS, gHotRects, gScreenState, gCursorList, gTimerList, gKeyRef, cNullCast, cNullQTmovie, NULLRECT, gSpritePropTypes, gQTproplist, cNUllCharmovie, sPICTSPRITE, sQTSPRITE, sCURSORSPRITE, sCPSprite, sQTCharSprite, gUnvObjects, gAngles, gLastCursor, gPlayingQT, gScreenWidth, gScreenHeight, gCurKeyList, gTransMovieName, gAnimationObjects, gDeathRow, gLastKeyList, gKeyFrameSound, gEnvironmentSound, gGlobal, gKeyFrameSoundMode, gHaveNavs, gNextEnvLetter, gNextDIRFile, gMIDIPlayTRUE, gInitalized, void, xNAVXOBJ, xCURXOBJ, gCPU, gfileSep, gRootPath, gHDpath, gXobjs, gXOBJPath, gCDpath, gCDName, gTempHotRects, gCreditTemplist, gsoundLevel
  2.  
  3. on ADDUnvOBJECTS
  4.   set addthese to []
  5.   set NumC to count(gUnvObjects)
  6.   repeat with X = 1 to NumC
  7.     if getaProp(getaProp(gOBJECTS, getAt(gUnvObjects, X)), #Aquired) = #true then
  8.       add(addthese, getAt(gUnvObjects, X))
  9.     end if
  10.   end repeat
  11.   ADDObjects(addthese)
  12. end
  13.  
  14. on DELUnvOBJECTS
  15.   set addthese to []
  16.   set NumC to count(gUnvObjects)
  17.   repeat with X = 1 to NumC
  18.     if getaProp(getaProp(gOBJECTS, getAt(gUnvObjects, X)), #Aquired) = #true then
  19.       add(addthese, getAt(gUnvObjects, X))
  20.     end if
  21.   end repeat
  22.   Delobjects(addthese)
  23. end
  24.  
  25. on playClick
  26. end
  27.  
  28. on PopUpMenu ObjRef
  29.   set obj to getaProp(gOBJECTS, ObjRef)
  30.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  31.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast, #NOW)
  32.   end if
  33.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  34.   updateStage()
  35.   repeat while the stillDown
  36.     do(getaProp(getaProp(obj, #action), #WhileDown))
  37.   end repeat
  38.   if (getaProp(obj, #CurRect) <> 1) and (getaProp(obj, #CurRect) <> #empty) then
  39.     repeat with X = 1 to 3
  40.       set the locV of sprite sCURSORSPRITE to -20000
  41.       set the castNum of sprite sCURSORSPRITE to getAt(getaProp(getaProp(obj, #cast), #menu), getaProp(obj, #CurRect))
  42.       set the loc of sprite sCURSORSPRITE to getaProp(getAt(getaProp(obj, #PopMenu), getaProp(obj, #CurRect)), #loc)
  43.     end repeat
  44.   end if
  45.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  46.   set the castNum of sprite sCURSORSPRITE to cNullCast
  47.   set the loc of sprite sCURSORSPRITE to point(-2000, -2000)
  48.   updateStage()
  49.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  50.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast, #NOW)
  51.   end if
  52.   if not voidp(getaProp(getaProp(obj, #action), #UP)) then
  53.     do(getaProp(getaProp(obj, #action), #UP))
  54.   end if
  55.   if getaProp(obj, #CurRect) <> #empty then
  56.     if not voidp(getaProp(getAt(getaProp(obj, #PopMenu), getaProp(obj, #CurRect)), #action)) then
  57.       do(getaProp(getAt(getaProp(obj, #PopMenu), getaProp(obj, #CurRect)), #action))
  58.     end if
  59.   end if
  60.   cursorandupdate()
  61. end
  62.  
  63. on CursorSave
  64.   set H to the mouseH
  65.   set v to the mouseV
  66.   set obj to getaProp(gOBJECTS, #SaveOBj)
  67.   set aRectNum to InUnvRect(getaProp(obj, #PopMenu), H, v)
  68.   if aRectNum <> #empty then
  69.     set the castNum of sprite sCURSORSPRITE to getAt(getaProp(getaProp(obj, #cast), #menu), aRectNum)
  70.     set the loc of sprite sCURSORSPRITE to getaProp(getAt(getaProp(obj, #PopMenu), aRectNum), #loc)
  71.     updateStage()
  72.     if aRectNum = 1 then
  73.       set VolObj to getaProp(gOBJECTS, #Volumeobj)
  74.       set smallRectNum to gsoundLevel + 1
  75.       set the castNum of sprite getaProp(getaProp(gOBJECTS, #SaveOBj), #spriteNum) to getaProp(getaProp(getaProp(gOBJECTS, #SaveOBj), #cast), #VolON)
  76.       set the castNum of sprite sCURSORSPRITE to getAt(getaProp(getaProp(VolObj, #cast), #menu), smallRectNum)
  77.       set the loc of sprite sCURSORSPRITE to getaProp(getAt(getaProp(VolObj, #PopMenu), smallRectNum), #loc)
  78.       updateStage()
  79.       UnvVolumeLoop(H, v)
  80.     end if
  81.   else
  82.     set the castNum of sprite sCURSORSPRITE to cNullCast
  83.     set the loc of sprite sCURSORSPRITE to point(-2000, -2000)
  84.     updateStage()
  85.   end if
  86.   setaProp(obj, #CurRect, aRectNum)
  87. end
  88.  
  89. on SetgHotrects OBJS
  90.   set rects to resetghotrects(OBJS)
  91.   if rects <> 0 then
  92.     exit
  93.   end if
  94. end
  95.  
  96. on UnvVolumeLoop H, v
  97.   set VolObj to getaProp(gOBJECTS, #Volumeobj)
  98.   set aRectNum to InUnvRect(getaProp(VolObj, #PopMenu), H, v)
  99.   set the castNum of sprite getaProp(getaProp(gOBJECTS, #SaveOBj), #spriteNum) to getaProp(getaProp(getaProp(gOBJECTS, #SaveOBj), #cast), #VolON)
  100.   repeat while (aRectNum <> #empty) and the stillDown
  101.     if aRectNum < 9 then
  102.       set the castNum of sprite sCURSORSPRITE to getAt(getaProp(getaProp(VolObj, #cast), #menu), aRectNum)
  103.       set the loc of sprite sCURSORSPRITE to getaProp(getAt(getaProp(VolObj, #PopMenu), aRectNum), #loc)
  104.       if (aRectNum - 1) <> gsoundLevel then
  105.         set gsoundLevel to aRectNum - 1
  106.         setSoundVolumes()
  107.         beep()
  108.       end if
  109.     end if
  110.     updateStage()
  111.     set v to the mouseV
  112.     set H to the mouseH
  113.     set aRectNum to InUnvRect(getaProp(VolObj, #PopMenu), H, v)
  114.   end repeat
  115.   set the castNum of sprite getaProp(getaProp(gOBJECTS, #SaveOBj), #spriteNum) to getaProp(getaProp(getaProp(gOBJECTS, #SaveOBj), #cast), #down)
  116. end
  117.  
  118. on InUnvRect Hotrects, H, v
  119.   set nHotr to count(Hotrects)
  120.   repeat with X = 1 to nHotr
  121.     if inside(point(H, v), getaProp(getAt(Hotrects, X), #HotRect)) then
  122.       return X
  123.     end if
  124.   end repeat
  125.   return #empty
  126. end
  127.  
  128. on ShowCredits
  129.   set obj to getaProp(gOBJECTS, #TheCredits)
  130.   set the loc of sprite getaProp(obj, #spriteNum) to getaProp(obj, #loc)
  131.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #HI)
  132.   updateStage()
  133.   set gCreditTemplist to [#Hotrects: gHotRects, #timer: gTimerList, #VideoLoc: the loc of sprite sQTCharSprite, #VideoRate: the movieRate of sprite sQTCharSprite]
  134.   set the movieRate of sprite sQTCharSprite to 0
  135.   set gHotRects to [:]
  136.   sort(gHotRects)
  137.   set gTimerList to [:]
  138.   sort(gTimerList)
  139.   set the loc of sprite sQTCharSprite to point(-2000, -2000)
  140.   set the HotRect of the CreditClose of gOBJECTS to the PDAHOTRECT of the CreditClose of gOBJECTS
  141.   set the hotState of the CreditClose of gOBJECTS to #PDA
  142.   ADDObjects([#TheCredits])
  143. end
  144.  
  145. on ShowUnvCredits
  146.   SuppendCurrentKF()
  147.   DELUnvOBJECTS()
  148.   set the HotRect of the CreditClose of gOBJECTS to the POPHOTRECT of the CreditClose of gOBJECTS
  149.   set the hotState of the CreditClose of gOBJECTS to #popUp
  150.   ADDObjects([#TheCredits])
  151. end
  152.  
  153. on CloseCredits
  154.   if the hotState of the CreditClose of gOBJECTS = #popUp then
  155.     Delobjects([#TheCredits])
  156.     setaProp(getaProp(gOBJECTS, #TheCredits), #State, #MAIN)
  157.     ReinstateCurrentKF()
  158.     updateStage()
  159.     exit
  160.   else
  161.     set obj to getaProp(gOBJECTS, #TheCredits)
  162.     set the loc of sprite getaProp(obj, #spriteNum) to getaProp(obj, #loc)
  163.     set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #HI)
  164.     updateStage()
  165.     set the loc of sprite sQTCharSprite to getaProp(gCreditTemplist, #VideoLoc)
  166.     Delobjects([#TheCredits])
  167.     set gHotRects to getaProp(gCreditTemplist, #Hotrects)
  168.     setaProp(obj, #State, #MAIN)
  169.     set gTimerList to getaProp(gCreditTemplist, #timer)
  170.     set the movieRate of sprite sQTCharSprite to getaProp(gCreditTemplist, #VideoRate)
  171.   end if
  172. end
  173.  
  174. on CreditChange Mode
  175.   set obj to getaProp(gOBJECTS, #TheCredits)
  176.   set OBJS to getaProp(getaProp(obj, #SpecialChild), getaProp(obj, #State))
  177.   if the shiftDown and (Mode = #MAINIT) then
  178.     set gGlobal to 1
  179.   end if
  180.   if not voidp(OBJS) then
  181.     Delobjects(OBJS)
  182.   end if
  183.   setaProp(obj, #State, Mode)
  184.   SetgHotrects(obj)
  185.   set OBJS to getaProp(getaProp(obj, #SpecialChild), Mode)
  186.   if not voidp(OBJS) then
  187.     ADDObjects(OBJS)
  188.   end if
  189.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), Mode)
  190. end
  191.